package com.gec.system.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gec.model.entity.SysCourse;
import com.gec.model.entity.SysCourseSign;
import com.gec.model.vo.SysCourseSignQueryVo;
import com.gec.system.mapper.SysCourseSignMapper;
import com.gec.system.service.SysCourseSignService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 签到发起表 服务实现类
 * </p>
 *
 * @author lxj
 * @since 2024-03-07
 */
@Service
@Transactional
public class SysCourseSignServiceImpl extends ServiceImpl<SysCourseSignMapper, SysCourseSign> implements SysCourseSignService {

    @Override
    public IPage<SysCourseSign> selectPage(IPage<SysCourseSign> p1, SysCourseSignQueryVo sysCourseSignQueryVo) {
        return this.baseMapper.selectPage(p1,sysCourseSignQueryVo);

    }

    @Override
    public void updateStatus(Long id, Integer status) {
        //1.查询出当前用户
        SysCourseSign sysCourseSign = this.baseMapper.selectById(id);
        //2.设置状态
        sysCourseSign.setStatus(status);
        //3.更新
        this.baseMapper.updateById(sysCourseSign);
    }
}
